/*
 * Reading a grade until it is in the required range
 * Suggested exercises:
 * - Add an input type verification (use Type.java)
 */
import java.util.Scanner;

public class Grade
{
    public static void main (String[] args) 
    {
        Scanner scan = new Scanner(System.in);
        Boolean done = false;
        int grade = 0;
        
        while (!done)
        {
            System.out.print("\nEnter a grade [0,100]: ");
            grade = scan.nextInt();
            if (grade>=0 && grade <=100) 
                done=true;
            else
            {
                System.out.print("Wrong range, please try again!");
                done = false;      
            }
        }

        System.out.println("The grade entered is " + grade);
    }
}
